---
title: Data.shiftWhile()
api: Data.shiftWhile
---

## Description

<Summary/>

The _scanner_ parameter will be called once for each byte in _Data_. It returns falsy to indicate the last byte to NOT shift out. Compare to [shiftTo()](/reference/api/Data/shiftTo).

## Syntax

``` js
data.shiftWhile(byte => shouldShiftOut(byte))
```

## Parameters

<Parameters/>

## See Also

* [Data](/reference/api/Data)
* [shift()](/reference/api/Data/shift)
* [shiftTo()](/reference/api/Data/shiftTo)
